<template>
	<view class="b_width hui">
		<view class="form_box">
			<view class="xx_box">

				<view class="b_flex_c input_box i_border">
					<view class="b_flex_c left">
						<view class="">账号</view>
					</view>
					<input v-model="form.account" placeholder="请输入账号" placeholder-style="color:#C2C7CE"></u--input>
				</view>

				<view class="b_flex_c input_box">
					<view class="b_flex_c left">
						<view class="">密码</view>
					</view>
					<input type="password" v-model="form.password" placeholder="请输入密码"
						placeholder-style="color:#C2C7CE"></u--input>
				</view>

			</view>
			<view class="sumbit" @click="submit">登录</view>
		</view>


	</view>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				form: {
					account: '',
					password: '',
				}
			}
		},
		onLoad(data) {

		},
		onShow() {

		},
		methods: {
			submit() {
				this.$post(this.$api.wxLogin, this.form, res => {
					let {
						code,
						data,
						msg
					} = res.data;

					if (code == 1) {

						uni.setStorageSync('wxToken', data.token);
						uni.reLaunch({
							url:'/pages/wx/index'
						})

					}else{
						 this.$Toast(msg);
					}
                    
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.b_width {
		width: 100%;
	}

	.hui {
		background: #F4F4F4;
		min-height: 100vh;
	}

	.form_box {
		box-sizing: border-box;
		padding: 40rpx 20rpx;
		font-size: 28rpx;
	}

	.xx_box {
		box-sizing: border-box;
		padding: 0rpx 20rpx;
		background-color: #fff;
		border-radius: 15rpx;

	}

	.bz_box {

		box-sizing: border-box;
		padding: 0 0 25rpx 0;
		border-bottom: 1rpx solid #EFEFEF;
	}

	.input_box {
		box-sizing: border-box;
		padding: 30rpx 0;

	}

	.i_border {
		border-bottom: 1rpx solid #EFEFEF;
	}

	.upload_box {
		box-sizing: border-box;
		padding: 30rpx 0 0 0;
	}

	.b_flex_c {
		display: flex;
		align-items: center;
	}

	.b_red {
		color: red;
	}

	.b_f_w {
		font-weight: bold;
	}

	.xing {
		width: 18rpx;
		box-sizing: border-box;
		padding: 10rpx 0 0 0;
	}

	.left {
		width: 15%;
	}

	.tc_box {
		width: 50%;
		text-align: center;
	}

	.sumbit {
		margin-top: 40rpx;
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		background-color: #E34305;
		color: #fff;
		border-radius: 30rpx;
	}

	.map_box {
		font-size: 30rpx;
	}

	.shen_box {
		display: flex;
		justify-content: center;
		flex-direction: column;
		align-items: center;
		height: 100vh;
	}
</style>